﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StripeOne.Core.Tools;

namespace StripeOne.ShortenUrl.Datalayer.Base
{
    public class StripeOneDatabaseConfig : StripeOneXml
    {
        #region Constructors

        public StripeOneDatabaseConfig() : base("Database", "default") { }

        public StripeOneDatabaseConfig(string section) : base("Database", section) { }

        #endregion

        #region Public Methods

        public static StripeOneDatabaseConfig Default
        {
            get
            {
                return new StripeOneDatabaseConfig("default");
            }
        }

        /// <summary>
        /// Network address of sql instance Example: .\\SQLEXPRESS
        /// </summary>
        public string DataSource { get { return this.GetString("DataSource"); } }
        /// <summary>
        /// Database name
        /// </summary>
        public string InitialCatalog { get { return this.GetString("InitialCatalog"); } }
        /// <summary>
        /// Persist security info
        /// </summary>
        public bool PersistSecurityInfo { get { return this.GetBool("PersistSecurityInfo"); } }
        /// <summary>
        /// Database user
        /// </summary>
        public string User { get { return this.GetString("User"); } }
        /// <summary>
        /// Database password
        /// </summary>
        public string Password { get { return this.GetString("Password"); } }
        /// <summary>
        /// Your Entity object names Exemple: "res://*/ShortenDatabase.csdl|res://*/ShortenDatabase.ssdl|res://*/ShortenDatabase.msl"
        /// </summary>
        public string Metadata { get { return this.GetString("Metadata"); } }
        /// <summary>
        /// Data prodiver name Example: System.Data.SqlClient
        /// </summary>
        public string Provider { get { return this.GetString("Provider"); } }

        #endregion
    }
}
